﻿using System;



#region License
/*
 *  Copyright (c) Dumuzi.cn 2009 , All rights reserved.
 *  CLR Version: 2.0.50727.4927
 *  NameSpace: Summer.Core.Ioc
 *  Author:Edwin Tai,戴佳顺
 *  Msn:edwin19861218@hotmail.com
 *  QQ: 1961218
 *  Date:2009-11-05 19:14:11
 *  Licensed under the Microsoft Public License (Ms-PL)
 *  This license governs use of the accompanying software. 
 *  If you use the software, you accept this license.
 *  If you do not accept the license, do not use the software.
 */
#endregion

namespace Summer.Core.Ioc
{
    /// <summary>
    /// Context container factory to create new instance of BaseContextContainer
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public abstract class ContextContainerFactory<T>
        where T : AbstractContextContainer<AbstractContextContainer<IContextObject>>
    {
        /// <summary>
        /// Create new instance
        /// </summary>
        /// <returns></returns>
        public static T CreateBaseContainer()
        {
            return (T)Activator.CreateInstance(typeof(T), true);
        }
        /// <summary>
        /// Create new instance
        /// </summary>
        /// <param name="args">Additional arguments to post to BaseContextContainer</param>
        /// <returns></returns>
        public static T CreateBaseContainer(params object[] args)
        {
            return (T)Activator.CreateInstance(typeof(T), true, args);
        }

    }
}
